#pragma once
#include "VolumeRenderPCH.h"
#include "Cube.h"
#include "VolumeObj.h"
#include "TFObj.h"
#include "OccupancyBrick.h"

class CLLOITBuildListsPass : public IRenderPass
{
public:
	CLLOITBuildListsPass(const std::string& vPassName, int vExecutionOrder) : IRenderPass(vPassName, vExecutionOrder) {}
	~CLLOITBuildListsPass();

	void initV() override;
	void updateV() override;

private:
	std::shared_ptr<CCube> m_pCube = nullptr;
	std::shared_ptr<CVolumeObj> m_pVolumeObj = nullptr;
	std::shared_ptr<CTFObj> m_pTFObj = nullptr;
	std::shared_ptr<hiveDVR::COccupancyBrick> m_pOccBricks = nullptr;

	GLuint m_ClearImageFBO;
	GLuint m_ListAtomicCounter;
	GLuint m_ListSSBO;
	GLuint m_InstanceBuffer;

	std::shared_ptr<hiveGraphics::STexture> m_pHeadPtrTex = nullptr;
	std::shared_ptr<hiveGraphics::STexture> __createHeadPtrTex2D();

	void __resetListAtomicCounter();
	void __genInstanceBuffer();
};